package com.base.data.elasticsearch.core.mapping;

import org.springframework.core.convert.converter.Converter;
import org.springframework.data.mapping.PersistentProperty;

public interface BaseElasticsearchPersistentProperty extends PersistentProperty<BaseElasticsearchPersistentProperty> {

    String getFieldName();

    public enum PropertyToFieldNameConverter implements Converter<BaseElasticsearchPersistentProperty, String> {

        INSTANCE;

        @Override
        public String convert(BaseElasticsearchPersistentProperty source) {
            return source.getFieldName();
        }
    }
}